﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link rel="stylesheet" href="~/assets/portal/assets/css/common.css" />
    <link rel="stylesheet" href="~/bussiness/js/base/reset.css" />
    <style>
        .ant-select-arrow, .ant-select-clear {
            position: absolute;
            right: 10px;
        }

        .title {
            font-size: 16px;
            font-weight: 600;
            color: #424758;
            display: flex;
            align-items: center;
        }

            .title::before {
                content: "";
                margin-right: 10px;
                display: inline-block;
                width: 4px;
                height: 18px;
                background: #0064E5;
            }

        .stable {
            border-collapse: collapse; /* 折叠边框，使之变为单一线划分 */
            border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
            width: 100%;
            margin-top: 20px;
            max-height: 800px;
            border: 1px solid red;
            overflow-y: scroll;
        }

            .stable th {
                background: #f2f6f9;
                font-size: 14px;
                font-weight: 600;
            }

            .stable th, .stable td {
                border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
                text-align: center;
                height: 48px;
            }
        /* 定义阴影样式 */
        .bottom-shadow {
            position: sticky; /* 使用 sticky 定位，保证吸底 */
            bottom: 0;
            left: 0;
            width: 100%;
            height: 4px; /* 阴影高度 */
            /* 使用 box-shadow 属性创建阴影效果 */
            box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2);
            background: transparent;
            pointer-events: none; /* 确保阴影不影响鼠标事件 */
            /* 添加过渡效果，让显示和隐藏更平滑 */
            transition: opacity 0.3s ease;
            opacity: 1;
        }
    </style>
}
<div id="PPESpecsAndConfigs" class="font-['SourceHanSansSC']">
    <a-style-provider hash-priority="high">
        <a-config-provider :locale="vlocale">
            <a-image :width="200"
                     :style="{ display: 'none',zIndex:100 }"
                     :preview="{visible:PPESpecsAndConfigsParams.previewShow.value,onVisibleChange:PPESpecsAndConfigsParams.setVisible}" :src="PPESpecsAndConfigsParams.imgUrl.value"></a-image>
            <m-pdf-pop-model></m-pdf-pop-model>
            <a-modal v-model:open="PPESpecsAndConfigsParams.popShow.value" width="70%" height="500px" :title="PPESpecsAndConfigsParams.popTitle.value " v-on:ok="PPESpecsAndConfigsParams.handlePopOk">
                <div v-if="PPESpecsAndConfigsParams.opType.value==1">
                    <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:4px">
                        <div style="font-weight: 500; font-size: 16px;">总申请数量：<span style="font-weight: 600; font-size: 20px; color: #0064e5">{{PPESpecsAndConfigsParams.detailPagination.value.total}}</span></div>
                        <a-button type="primary" v-on:click="PPESpecsAndConfigsParams.clearData">清空数据</a-button>
                    </div>

                    <a-table :pagination="false" v-on:change="PPESpecsAndConfigsParams.handleDetailTableChange" :data-source="PPESpecsAndConfigsParams.detailDataSource.value" :columns="PPESpecsAndConfigsParams.detailColumns.value">
                    </a-table>
                </div>
                <div v-else>

                    <a-form style="margin-top:40px"
                            :model="PPESpecsAndConfigsParams.addParams.value">
                        <a-form-item label="姓名">
                            <a-input style="width:200px" v-model:value="PPESpecsAndConfigsParams.addParams.value.name" allow-clear placeholder="请填写姓名" />
                        </a-form-item>

                        <a-form-item label="工号">
                            <a-input style="width:200px" v-model:value="PPESpecsAndConfigsParams.addParams.value.code" allow-clear placeholder="请填写工号" />
                        </a-form-item>


                        <a-form-item label="申请数量">

                            <a-input-number v-model:value="PPESpecsAndConfigsParams.addParams.value.number" placeholder="申请数量" :disabled="PPESpecsAndConfigsParams.opType.value==1" min="1" />

                        </a-form-item>


                    </a-form>

                </div>

            </a-modal>



            <header class="px-5 box-border">
                <div class="flex items-center">
                    <div class="w-full h-[48px] text-[13px]  rounded-lg mx-auto my-[10px]  bg-white  text-[#888888] text-3xl flex items-center px-10">   <div class="w-22 h-22 bg-blue-200 mr-5"> <img class="w-full h-full cursor-pointer" v-on:click="PPESpecsAndConfigsParams.vvback()" src="~/Assets/nimgs/exit.png" alt="返回" /></div> <span class="text-[]">信息门户<span class="mx-2">/</span>劳防用品<span class="mx-2">/</span><span class="text-[#424758] text-[15px]">用品编码配置</span> </span>  </div>
                </div>

                <a-card :bordered="true" class="w-full  mt-12">
                    <template #title>
                        <div class="w-full flex justify-between items-center;">
                            <div class="flex items-center"> <div>用品编码配置</div> <div class="ml-7"></div></div>
                        </div>



                    </template>
                    <a-spin :spinning="PPESpecsAndConfigsParams.uploadLock.value" tip="加载中，请耐心等待..." />
                    <div class="title">用品基本信息</div>
                    <a-form layout="inline"
                            style="margin-top:20px"
                            :model="PPESpecsAndConfigsParams.configData.value">
                        <a-form-item label="用品名称：">
                            @*<a-input disabled style="width:auto" v-model:value="PPESpecsAndConfigsParams.baseInfo.value.ProductName">

                            </a-input>*@
                            <div style="font-weight: bolder; font-size: 16px; color: #0366e5 ">{{PPESpecsAndConfigsParams.baseInfo.value.ProductName}}</div>
                            @*<a-input disabled  style="min-width: 200px; max-width: 500px; width: auto;" value="加载中，请耐心等待...加载中，请耐心等待...加载中，请耐心等待...加载中，请耐心等待...">
                            </a-input>*@
                        </a-form-item>
                        <a-form-item label="用品类型：">
                            @*<a-input disabled v-model:value="PPESpecsAndConfigsParams.baseInfo.value.TypeName">

        </a-input>*@
                            <div style="font-weight: bolder; font-size: 16px; color: #0366e5 ">{{PPESpecsAndConfigsParams.baseInfo.value.TypeName}}</div>
                        </a-form-item>

                    </a-form>
                    <div class="title" style="margin-top:30px">用品编码配置</div>


                <div class="box" ref="scrollt" v-on:scroll="PPESpecsAndConfigsParams.scrollt" style="max-height:650px;min-height:400px; overflow-y:scroll;position:relative">
                    <table class="stable">
                        <tr>
                            <th>序号</th>
                            <th>规格参数</th>
                            <th>用品编码</th>
                            <th>备注</th>
                            <th>操作</th>
                        </tr>
                        <tr v-for="(e,i) in PPESpecsAndConfigsParams.settingList.value" :key="i">
                            <td>
                                {{i+1}}
                            </td>
                            <td style="max-width:600px;overflow-x:scroll;padding:0 20px;">
              
                                    <a-space>

                                        <a-select v-for="es in e.AttrList" :key="es.Id" v-model:value="es.Selected"
                                                  show-search
                                                  placeholder="请选择类型"
                                                  style="width:150px;"
                                                  :field-names="{
                      label: 'AttributeValue',
                      value: 'Id',
                      }"
                                                  :options="es.ItemList"
                                                  :filter-option="PPESpecsAndConfigsParams.filterOption"
                                                  v-on:change="PPESpecsAndConfigsParams.handleTypeChange"></a-select>
                                    </a-space>

                     
                        
                            </td>
                            <td>
                                <a-input style="width:300px" v-model:value="e.ProductCode">
                                </a-input>
                            </td>
                            <td>
                                <a-input style="width:300px" v-model:value="e.Remark">
                                </a-input>
                            </td>
                            <td>
                                <a-button v-if="i==0" v-on:click="PPESpecsAndConfigsParams.addConfig" type="primary">新增</a-button>
                                <a-button v-else v-on:click="PPESpecsAndConfigsParams.delConfig(i)" type="primary" danger>删除</a-button>
                            </td>
                        </tr>
                    </table>
                    <div v-show="PPESpecsAndConfigsParams.shadowShow.value" class="bottom-shadow"></div>
                </div>

                </a-card>
            </header>
            <m-bottom-btns></m-bottom-btns>
        </a-config-provider>
    </a-style-provider>
</div>
@section Js{
    <script src="~/bussiness/js/base/tailwind.js"></script>
    <script type="module">
        import Composition from '../../bussiness/js/pg/PPE/SpecsAndConfigs.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")'
        import localeValues from '../../Bussiness/js/base/es/locale/zh_CN.js'
        singalApp('PPESpecsAndConfigs', Composition, localeValues)
    </script>
}
